﻿$(document).ready(function(){   
    var inputUserNameObj = $("#username");      
    inputUserNameObj.keyup(function(){   
        var text = inputUserNameObj.val();
        if(text == " "){   
        	$("#t1").css("border-color","red"); 
        	
        }else{   
            $("#t1").css("border-color","black");   
        }   
    });   
       
    $("#username").blur(function(){   
        var text = inputUserNameObj.val();
        
        $.post("front/usernameCheck.action?userVo.name="+text,null,function(response){   
            
            if((response=="用户名已存在,请重新输入....")||(response=="不能为空，请重新输入")){
             document.getElementById("tip1").innerHTML="<font color='red'>"+response+"</font>";
            }else{
             document.getElementById("tip1").innerHTML="<font color='blue'>"+response+"</font>";
            }
        });   
    });   
       
});  
